#include<iostream>
#include<algorithm>
using namespace std;
// zdl:: 看到这样的题目就要想到使用发二分答案来接决类似的问题
const int N = 1e5 + 10;
int n, m, c;
int a[N];
int check(int x)
{
    
    int r = 1, l = 1;
    int cnt = 0;
    while (r <= n)
    {
        while (r <= n && a[r] - a[l] <= x && r - l + 1 <= c) r++;
        cnt ++;
        l = r;
    }
    return cnt;
}
int main()
{
    cin >> n >> m >> c;
    for (int i = 1; i <= n; i++) cin >> a[i];
    sort(a + 1, a + 1 + n);
    int l = 0, r = a[n] - a[1];
    while (l < r)
    {
        int mid = (l + r) / 2;
        if (check(mid) <= m) r = mid;
        else l = mid + 1;
    }
    cout << l << endl;
    return 0;
}